import {DynamicObject, PageParams} from "@/services/typings";
import {addData, deleteById, listData, pageData, post, put, updateById} from "@/services/base-request";

export const pageSysJob = (params: PageParams, options?: DynamicObject) => {
  return pageData('/sysJob', params, options)
}

export const listSysJob = (params: PageParams, options?: DynamicObject) => {
  return listData('/sysJob', params, options)
}
export const addSysJob = (data: any, options?: DynamicObject) => {
  return addData('/sysJob', data, options)
}

export const updateSysJob = (data: any, options?: DynamicObject) => {
  return updateById('/sysJob', data, options)
}

export const deleteSysJob = (id: string | number, options?: DynamicObject) => {
  return deleteById('/sysJob', id, options)
}
export const changeJobStatusAPI = (data: any, options?: DynamicObject) => {
  return put('/sysJob/changeStatus', data, options)
}

export const runJobSAPI = (data: { jobId: string }, options?: DynamicObject) => {
  return post('/sysJob/run', data, options)
}
